 import java.awt.*;
import java.io.*;
import java.util.*;
import ij.*;
import ij.io.*;
import ij.measure.*;
import ij.plugin.*;

public class LCT_Opener extends ImageStack implements PlugIn {

 	public void run(String arg) {
		OpenDialog od = new OpenDialog("Open Lct file...", arg);
		String directory = od.getDirectory();
		String fileName = od.getFileName();
		String icsfileName;
		if (fileName==null)
			return;

		// sort out the ics and ids filenames
		if (fileName.endsWith(".lct")) {
			icsfileName=new String (fileName);
			File f = new File(directory+icsfileName); //wsr
			if (!f.exists()) {
				IJ.showMessage("LCT Opener", "\""+icsfileName+"\" not found");
				return;
			}
		}
		else {
			IJ.showMessage ("LCT Opener", "Please select a file with the .lct"); //wsr
			return;
		}
		LCTImport d = new LCTImport(icsfileName, directory);
		d.OpenIcs();
	}
}